<include file="Public:head"/>
<div class="content">
	<div class="cLineB">
              <h4 class="left">我的分组</h4>
              <div class="clr"></div>
          </div>
          <div class="cLine">
              <div class="pageNavigator left">
             以下是关注您的用户的分组信息
            </div>
            <div class="clr"></div>
          </div>

	<div class="cLineC" style="line-height: 32px;">
		<a href="{cms>:U('SubscribeGroup/add')}" class="btnGrayS vm bigbtn">创建新分组</a>
	</div>

	<div class="msgWrap">
            <TABLE class="ListProduct" border="0" cellSpacing="0" cellPadding="0" width="100%">
              <THEAD>
                <TR>
					<TH class="category">分组ID</TH>
					<TH class="answer">分组名称</TH>
					<TH class="category">分组用户数</TH>
					<TH class="category">操作</TH>
                </TR>
              </THEAD>
              <TBODY>
                <TR></TR>
				<volist name="models" id="model">
				<tr>
                  <td>{cms>$model.groupid}</td>
                  <td>{cms>$model.groupname}</td>
                  <td>{cms>$model.groupcount}</td>
                  <td class="norightborder">
							<a href="{cms>:U('SubscribeGroup/edit',array('id'=>$model['groupid']))}">编辑</a>
					</td>
                </tr>
				</volist>
                              
              </TBODY>
            </TABLE>
          </div>
          
          <div class="cLine">
            <div class="pageNavigator right">
                 <div class="pages">{cms>$page}</div>
              </div>
            <div class="clr"></div>
          </div>
          
	<script type="text/javascript">
	function updateSubscribeGroup(){
		window.location = "{cms>:U('SubscribeGroup/update')}";
	}
	
	function updateUserGroupInfo(){
		if(confirm("更新数据需要对用户数据逐个更新，可能会花费大量时间，你确定要个更新？")){
			showStop();
			window.location = "{cms>:U('SubscribeGroup/updateMember')}";
		}else{
			return false;
		}
	}
	
	function showStop(){
		var shadeDiv = $("#shadeDiv");
		if(shadeDiv.height()){
			shadeDiv.show();
		}else{
			shadeDiv = $("<div id='shadeDiv' style='width:100%;position:fixed;top:0;left:0;z-index:999;background:#777777 url(themes/manual/default/loading.gif);background:url(themes/Static/kindeditor/themes/common/loading.gif) no-repeat 50% 50%;background-color: rgba(77,77,77,0.4);filter:Alpha(opacity=40);'></div>");
			var wheight = $(window).height();
			shadeDiv.css('height',wheight+'px');
			$("body").append(shadeDiv);
		}
	}
	
	
	</script>

	<input type="button" value="更新分组信息"  class="btnGreen left"  onclick="updateSubscribeGroup();"/>
	<div style="padding:10px 0 0 100px;">&nbsp;或者你可以<a href="https://mp.weixin.qq.com/" target="_blank" style="color:#00f;">点击这里</a>去微信官方后台查看更多具体信息</div>           
    <br/>
    <input type="button" value="更新用户所在分组信息"  class="btnGreen left"  onclick="updateUserGroupInfo();"/>
</div>
<div class="clr"></div>    
<include file="Public:footer"/>	